import type { RouteRecordRaw } from "vue-router";
import Layout from "@/views/layout/index.vue";
const mainRouters: RouteRecordRaw[] = [
	{
		path: "/",
		component: Layout,
		redirect: "/home",
		children: [
			{
				path: "/home",
				name: "Home",
				component: () => import("@/views/home/index.vue"),
				meta: {
					title: "首页"
				}
			},
			{
				path: "/approveList",
				name: "ApproveList",
				component: () => import("@/views/approveList/index.vue"),
				meta: {
					title: "流程列表",
					showBack: true
				}
			},
			{
				path: "/approve",
				name: "Approve",
				component: () => import("@/views/approve/index.vue"),
				meta: {
					title: "流程审批",
					showBack: true
				}
			},
			{
				path: "/pur/form",
				name: "PurForm",
				component: () => import("@/views/pur/form.vue"),
				meta: {
					title: "研发试制、采购申请流程申请",
					showBack: true
				}
			},
			{
				path: "/purchaseInquiry/form",
				name: "PurchaseInquiryForm",
				component: () => import("@/views/purchaseInquiry/form/index.vue"),
				meta: {
					title: "采购询比价定价流程申请",
					showBack: true
				}
			},
			{
				path: "/stampApply/form",
				name: "StampApplyForm",
				component: () => import("@/views/stampApply/form/index.vue"),
				meta: {
					title: "用章使用申请",
					showBack: true
				}
			}
		]
	},

	{
		path: "/404",
		name: "404",
		component: () => import("@/views/404/index.vue")
	}
];

export const routes: RouteRecordRaw[] = [
	...mainRouters,
	{
		path: "/:pathMatch(.*)",
		redirect: "/404"
	}
];
